package io.alterac.blurkit;

import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.agp.window.service.Display;
import ohos.agp.window.service.DisplayManager;
import ohos.media.image.Image;
import ohos.media.image.PixelMap;
import ohos.media.image.common.PixelFormat;
import ohos.media.image.common.ScaleMode;
import ohos.media.image.common.Size;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ExampleOhosTest {
    @Test
    public void testBundleName() {
        Ability ability = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility();
        PixelMap.InitializationOptions initializationOptions = new PixelMap.InitializationOptions();
        initializationOptions.editable = true;
        initializationOptions.scaleMode = ScaleMode.CENTER_CROP;
        initializationOptions.pixelFormat = PixelFormat.ARGB_8888;
        Display display = DisplayManager.getInstance().getDefaultDisplay(ability).get();
        int width = display.getAttributes().width;
        int height = display.getAttributes().height;
        Size size = new Size(width, height);
        initializationOptions.size = size;
        PixelMap pixelMap2 = PixelMap.create(initializationOptions);
        PixelMap pixelMap = BlurKit.getInstance().blur(pixelMap2);
        Boolean flag = pixelMap != null;
        assertEquals(true, flag);
    }
}